<%@taglib tagdir="/WEB-INF/tags/hunk" prefix="hunk"%>
<%@taglib uri="/WEB-INF/tld/c.tld" prefix="c"%>
<%@taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html"%>
<%@tag description="put the tag description here" pageEncoding="UTF-8"%>
<%@attribute name="name" required="true"%>
<%@attribute name="value"%>
<%@attribute name="label"%>
<%@attribute name="readOnly" type="java.lang.Boolean"%>
<%@attribute name="showTime" type="java.lang.Boolean"%>
<%@attribute name="id"%>
<%@attribute name="validate"%>
<%@attribute name="container"%>
<%@attribute name="error_message"%>
<%@attribute name="styleClass"%>
<%@attribute name="disabled"%>
<%@attribute name="tooltip"%>

<c:if test="${empty showTime}">
    <c:set var="showTime" value="false"/>
</c:if>

<c:if test="${calendar != 'calendar'}">
    <script type="text/javascript" src="${path}/js/calendar/datetimepicker_css.js"></script>
</c:if>
<c:set var="calendar" value="calendar" scope="request"/>
<c:if test="${id == null}" var="_var">
    <c:set var="id" value="${name}"/>
</c:if>
<c:if test="${container == null}">
    <c:set var="container" value="td"/>
</c:if>
<c:if test="${container != 'NULL'}">
    <${container}>
</c:if>

<c:if test="${readOnly}">
    <c:set var="readOnlyClass" value="readOnly"/>
</c:if>

<c:if test="${label != null}">
    <label>
        ${label}
    </label>
</c:if>

<div class="float-left">
    <c:choose>
        <c:when test="${form != null}">
            <c:choose>
                <c:when test="${value != null}">
                    <html:text property="${name}" name="${form}"  styleId="${id}" styleClass="date text float-left ${name} ${styleClass} ${readOnlyClass}" readonly="${readOnly}" value="${value}"  disabled="${disabled}"/>
                </c:when>
                <c:otherwise>
                    <html:text property="${name}" name="${form}" styleId="${id}" styleClass="date text float-left ${name} ${styleClass} ${readOnlyClass}" readonly="${readOnly}"  disabled="${disabled}"/>
                </c:otherwise>
            </c:choose>
        </c:when>
        <c:otherwise>
            <html:text property="${name}"  styleId="${id}" styleClass="date text float-left ${name} ${styleClass} ${readOnlyClass}"  readonly="${readOnly}"  value="${value}"  disabled="${disabled}"/>
        </c:otherwise>
        <img class="float-left" alt="calendar"  height="20px" src="${path}/images/calendar/calendar.gif" onclick="NewCssCal('${id}','mmddyyyy','dropdown',${showTime})" style="cursor: pointer"/>
    </c:choose>
</div>
<%@include file="error.jsf" %>
<jsp:doBody/>
<c:if test="${container != 'NULL'}">
    </${container}>
</c:if>
<c:if test="${not empty tooltip}">
    <hunk:tooltip id="${id}" tooltip="${tooltip}"/>
</c:if>